package zouran.shounewsspringboot.controller;

import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zouran.shounewsspringboot.entity.ResultMap;
import zouran.shounewsspringboot.service.IdentityService;

/**
 * @author zouran
 * createDate：2023/5/31  21:44
 */
@CrossOrigin
@RestController
@RequestMapping("/identity")
public class IdentityController {
    private final IdentityService identityService;
    private final ResultMap<Object> resultMap;

    public IdentityController(IdentityService identityService, ResultMap<Object> resultMap) {
        this.identityService = identityService;
        this.resultMap = resultMap;
    }

    /**
     * @param name 访问类型 如微信 网页
     * @return 数组集合
     */
    @RequestMapping("/getAllAuthorByType")
    public ResultMap<Object> getAllAuthorByType(@Param("name") String name){
        return resultMap.success(identityService.getAllAuthorByType(name));
    }
}
